<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<script type="text/javascript" src="../js/jquery.min.js"></script>

	</head>

	<body>
		<!--html部分-->
		<div id="myDiv">
			<h2>通过ajax改变文本</h2></div>
		<button id="b01" type="button">点我</button>

		<button id="b02">按钮</button>
		<button id="b03">按钮</button>
		<script>
			$("#b01").click(function() {
				$("#myDiv").load('new_file.txt')
			})

			//通过get
			$("#b02").click(function() {
				$.get("../php/index.php",
					function(data) {
						alert("Data Loaded: " + data);
					});
			});
			//通过post
			$(document).ready(function() {
				$("#b03").click(function() {
					$.post("../php/index.php",
						function(data) {
							alert("Data Loaded: " + data);
						});
				});
			});
		</script>
	</body>

</html>